import '@/style/main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import App from './App.vue'
import router from './router'

// echarts
import * as echarts from 'echarts/core'
import { GridComponent, type GridComponentOption } from 'echarts/components'
import { LineChart, BarChart } from 'echarts/charts'
import type { LineSeriesOption, BarSeriesOption } from 'echarts/charts'
import { UniversalTransition } from 'echarts/features'
import { CanvasRenderer } from 'echarts/renderers'
echarts.use([GridComponent, LineChart, BarChart, CanvasRenderer, UniversalTransition])
type EChartsOption = echarts.ComposeOption<GridComponentOption | LineSeriesOption | BarSeriesOption>

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(createPinia())
app.use(router)
app.use(ElementPlus, { size: 'large' })
app.mount('#app')
